package sum.book.common.feign.config;

import com.netflix.hystrix.strategy.HystrixPlugins;
import feign.RequestInterceptor;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import sum.book.common.feign.interceptor.OAuth2FeignRequestInterceptor;


/**
 * @Auther: ZhangGN
 * @Description: Feign客户端配置
 * @Date 2022/12/9 14:02
 **/
@Configuration
@EnableFeignClients(basePackages = "sum.book.*.*.feign")
public class FeignClientConfig {

    @Bean
    RequestInterceptor requestInterceptor() {
        return new OAuth2FeignRequestInterceptor();
    }

//    @PostConstruct
//    public void init() {
//        HystrixPlugins.getInstance().registerConcurrencyStrategy(new RequestContextHystrixConcurrencyStrategy());
//    }

}
